<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../Template/TechnicainTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui" >

    <ui:define name="content">
        <f:view>
            <h:form id="form">
                <h:outputLabel value="MANAGE COMPLAINT BY TECHNICAIN" style="color: #0099cc;font-size: large;font-weight: bold"/>
                <p:panelGrid columns="1" style="width: 780px">

                    <f:facet name="header">  
                        List All Complaint
                    </f:facet>
                    <h:form id="form">
                      
                            <h1><h:outputText value="List"/></h1>
                            <p:dataTable value="#{complaintBean.complaints}" var="item" 
                                 paginator="true" rows="10"  
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                 rowsPerPageTemplate="5,10,15" style="width: 760" rowKey="#{item.complaintID}" selection="#{complaintBean.selectedComplaint}" selectionMode="single" >
                                
                                <p:column>
                                    <f:facet name="header"  >
                                        <h:outputText value="ComplaintID"/>
                                    </f:facet>
                                    <h:outputText value="#{item.complaintID}"/>
                                </p:column>
                                <p:column>
                                    <f:facet name="header">
                                        <h:outputText value="ComplaintNo"/>
                                    </f:facet>
                                    <h:outputText value="#{item.complaintNo}"/>
                                </p:column>
                                  <p:column>
                                    <f:facet name="header">
                                        <h:outputText value="Status"/>
                                    </f:facet>
                                    <h:outputText value="#{item.status.statusId}"/>
                                </p:column>
                                <p:column>
                                    <f:facet name="header">
                                        <h:outputText value="PriorityID"/>
                                    </f:facet>
                                    <h:outputText value="#{item.priorityID.priorityID}"/>
                                </p:column>
                                <p:column>
                                    <f:facet name="header">
                                        <h:outputText value="CategoryID"/>
                                    </f:facet>
                                    <h:outputText value="#{item.categoryID.categoryID}"/>
                                </p:column>
                                <p:column>
                                    <f:facet name="header">
                                        <h:outputText value="AccountID"/>
                                    </f:facet>
                                    <h:outputText value="#{item.accountID.accountID}"/>
                                </p:column>
                                <f:facet name="footer">  
                                <p:commandButton id="viewButton" value="View" icon="ui-icon-search"  
                                update=":form:form:display" oncomplete="complaintDialog.show()"/> 
                                <p:commandButton action="#{complaintBean.edit()}" value="Edit Status" style="margin:0"/>
                                </f:facet>   
                            </p:dataTable>
                              <p:dialog id="dialog" header="Complaint Detail" widgetVar="complaintDialog" resizable="true"  
                                              showEffect="explode" hideEffect="explode">  

                                  <h:panelGrid id="display" columns="2" cellpadding="20" cellspacing="20">                                
                                        <h:outputText value="ComplaintID:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.complaintID}" />
                                        <h:outputText value="ComplaintNo:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.complaintNo}" />
                                        <h:outputText value="AccountID:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.accountID.accountID}" />
                                        <h:outputText value="CategoryID:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.categoryID.categoryID}" />                                          
                                        <h:outputText value="PriorityID:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.priorityID.priorityID}" />  
                                        <h:outputText value="ActualTime:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.actualTime}" />  
                                        <h:outputText value="DateLogdge:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.dateLodge}" />  
                                        <h:outputText value="DateClose:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.dateClose}" />  
                                        <h:outputText value="Status:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.status.statusId}" />  
                                        <h:outputText value="Note:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.note}" />  
                                        <h:outputText value="SendTime:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.sendTimes}" />  
                                        <h:outputText value="Description:" />  
                                        <h:outputText value="#{complaintBean.selectedComplaint.description}" />  
                                    </h:panelGrid>  
                                </p:dialog>    
                        </h:form>

                   

                   
 
                    
                </p:panelGrid>
            </h:form>
        </f:view>

    </ui:define>

</ui:composition>
